﻿using System;
using System.Text;

class SubstringInText
{
    static void Main()
    {
        string text = "We are living in an yellow submarine. We don't have anything else." +
                       " Inside the submarine is very tight. So we are drinking all the day. We will move out of it in 5 days.";
        string substring = "in";
        int count = 0;
        int index = text.IndexOf(substring);

        text = text.ToLower();
        substring = substring.ToLower();

        while (index != -1)
        {
            count++;
            index = text.IndexOf(substring, index + 1);
        }

        Console.WriteLine("{0} substrings found.", count);
    }
}
